<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>test</title>
  <script src="./js/ArrayPrototype.js"></script>
</head>
<body>
  <script>
    console.log('测试数组fakeFlat方法')
    const arr = [,,'第一层', ['第二层', ], ['3', ['第三层', , 3], ]]
    // 传非数值
    console.log(arr.fakeFlat('jxshfjdshf'))
    // 传小于0的数值
    console.log(arr.fakeFlat(-2))
    // 传0
    console.log(arr.fakeFlat(0))
    // 传大于0的数值
    console.log(arr.fakeFlat(Infinity))
    // 传默认1
    console.log(arr.fakeFlat())
  </script>

  <script>
    console.log('测试数组fakePush等方法')
    const arr1 = [, 1, , 2]
    console.log(arr1.fakePush('3', undefined, 4))
    console.log(arr1)
    console.log(arr1.fakePop())
    console.log(arr1)
    console.log(arr1.fakeShift())
    console.log(arr1)
    console.log(arr1.fakeUnshift(undefined, '-1', { key: 'value' }))
    console.log(arr1)
    console.log(arr1.fakeFilter(item => item))

    console.log('测试数组fakeFind等方法')
    const arr2 = [, 5, 10, , 5] 
    console.log(arr2.fakeFind(item => item === 5))
    console.log(arr2.fakeSome(item => item === 5))
    // console.log(arr2.fakeEvery(item => item === 5))
    console.log(arr2.fakeJoin({}))
    console.log(arr2.fakeSplice(0))
  </script>

  <script>
    
  </script>
</body>
</html>